package com.aps.common.entity;

import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

import java.time.LocalDateTime;
import java.time.LocalTime;
import java.time.format.DateTimeFormatter;

/**
 * @Author nbZhuozh
 * @Date 2025-10-15  12:01
 *
 * 时间段
 **/

@Data
@AllArgsConstructor
@NoArgsConstructor
public class ApsInterval {

    //开始时间
    LocalTime startTime;

    //结束时间
    LocalTime endTime;

    //xx：xx 时、分 处理   "18:00"
    public static ApsInterval of(String startTime, String endTime) {
        return new ApsInterval(LocalTime.parse(startTime, DateTimeFormatter.ofPattern("HH:mm")),
                LocalTime.parse(endTime, DateTimeFormatter.ofPattern("HH:mm")));
    }

}
